#include<iostream>
#include<string>
using namespace std;
class Cstudent{
	private:
		string reg_num;
		string Name;
		double math;
		double english;
		double computer;
	public:
		Cstudent(std::string num,std::string name,double math_,double english_,double computer_):reg_num(num),Name(name),math(math_),english(english_),computer(computer_){};
		~Cstudent(){
			cout<<"析构函数被调用"<<endl;
		}
		double sum(){
			return math+english+computer;
		}
		double average(){
			return(math+english+computer)/3;
		}
		void print(){
			cout<<"注册号:"<<reg_num<<endl;
			cout<<"姓名:"<<Name<<endl;
			cout<<"数学成绩:"<<math<<endl;
			cout<<"英语成绩:"<<english<<endl;
			cout<<"计算机成绩:"<<computer<<endl;
			cout<<"总成绩:"<<sum()<<endl;
			cout<<"平均成绩:"<<average()<<endl;
		}
    std::string get_reg_num() const {  
        return reg_num;  
    }  
	};
	int main(){
	const int num_students = 3;
	Cstudent students[num_students]={
    Cstudent("1","shi",10,20,30),
    Cstudent("2","tian",40,50,60),
    Cstudent("3","li",70,80,90)};
    for(int i = 0;i < num_students;i ++){
    	students[i].print();
    	std::cout<<std::endl;
	}
	   return 0;
}